<?php
/**
 * @package		Joomla.Site
 * @subpackage	mod_weblinks
 * @copyright	Copyright (C) 2005 - 2009 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

class modSocialinksHelper
{
	static function getList($params)
	{
		$reseaux=array("twitter","facebook","google","rss");
		$ar_final=array();
		foreach($reseaux as $reseau){
			$texte=$params->get("ln_".$reseau);
			
			if(!empty($texte)){
				$ordre=(int) $params->get("ord_".$reseau);
				
				if(!empty($ordre))
					$ar_final[$ordre]=array("reseau"=>$reseau,"lien"=>$texte);
				else
					$ar_final[]=array("reseau"=>$reseau,"lien"=>$texte);
			}
		}
		ksort($ar_final);
		return $ar_final;

	}
}
